import {
	getBindCode,
	bindPhoneNumber,
	getRecommendInfoList,
	getRecommendTopList,
	getDrawPrizeRecord
} from '~/service/user';
const getBindCodeAction = params => (dispatch, getState) => {
	return getBindCode(params);
};
const bindPhoneNumberAction = params => (dispatch, getState) => {
	return bindPhoneNumber(params).then(data =>(dispatch({
		type: 'phoneNumber',
		payload: {phoneNumber: params.phoneNumber}
	})));
};
const getRecommendInfoListAction = params => (dispatch, getState) => {
	return getRecommendInfoList(params).then(recommendInfo =>(dispatch({
		type: 'recommendInfo',
		payload: {recommendInfo}
	})));
};
const getRecommendTopListAction = params => (dispatch, getState) => {
	return getRecommendTopList(params).then(recommendTopList =>(dispatch({
		type: 'recommendTop',
		payload: {recommendTopList}
	})));
};
const getDrawPrizeRecordAction = params => (dispatch, getState) => {
	return getDrawPrizeRecord(params).then(data =>(dispatch({
		type: 'winrecord',
		payload: data
	})));
};


export { getBindCodeAction,
	bindPhoneNumberAction,
	getDrawPrizeRecordAction,
	getRecommendTopListAction,
	getRecommendInfoListAction};
export default { getBindCodeAction};
